<template>
  <el-form :inline="true" :model="params">
    <el-form-item label="学工号/教职工号">
      <el-input v-model="params.stdid"  disabled placeholder="学工号/教职工号"></el-input>
    </el-form-item>
    <el-form-item label="信誉等级">
      <el-select v-model="params.xinyu" placeholder="信誉等级">
        <el-option label="良好" value="良好"></el-option>
        <el-option label="一般" value="一般"></el-option>
        <el-option label="失信" value="失信"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="update">确定修改</el-button>
    </el-form-item>
  </el-form>
</template>


<script>
import request from "@/utils/request";

export default {
  name: "UpdateUser.vue",
  data() {
    return {
      params: {}
    }
  },
  created() {
    const stdid = this.$route.query.stdid
    request.get('/user/' + stdid).then(res => {
      this.params = res.data
    })
  },
  methods: {
    update() {
      request.put('/user/update', this.params).then(res => {
        if (res.code === '200') {
          this.$notify.success('标注成功')
          this.$router.push("/user")
        } else {
          this.$notify.error(res.msg)
        }
      })
    }
  }
}
</script>

<style scoped>

</style>